import request from '@/utils/request'

// 获取权限列表
export function getPermissionList(params) {
  return request({
    url: '/permission/index',
    method: 'get',
    params
  })
}

// 获取权限树
export function getPermissionTree(params) {
  return request({
    url: '/permission/tree',
    method: 'get',
    params
  })
}

// 获取权限详情
export function getPermissionDetail(id) {
  return request({
    url: `/permission/detail/`,
    method: 'get',
    params:{id}
  })
}

// 添加权限
export function addPermission(data) {
  return request({
    url: '/permission/add',
    method: 'post',
    data
  })
}

// 编辑权限
export function editPermission(data) {
  return request({
    url: '/permission/edit',
    method: 'put',
    data
  })
}

// 删除权限
export function deletePermission(id) {
  return request({
    url: `/permission/delete/`,
    method: 'delete',
    params:{id}
  })
} 